import request from '@/utils/request'

// 获取章节列表
export const getChapterList = (params) => {
  return request({
    url: '/detail/chapter/list',
    method: 'get',
    params
  })
}

// 获取章节详情
export const getChapterDetail = (params) => {
  return request({
    url: '/detail/chapter/detail',
    method: 'get',
    params
  })
}

// 添加章节
export const addChapter = (data) => {
  return request({
    url: '/detail/chapter/add',
    method: 'post',
    data
  })
}

// 编辑章节
export const editChapter = (data) => {
  return request({
    url: '/detail/chapter/edit',
    method: 'put',
    data
  })
}

// 删除章节
export const deleteChapter = (data) => {
  return request({
    url: '/detail/chapter/delete',
    method: 'delete',
    data
  })
}

// detail.js - 添加码字日历接口封装

// 获取码字日历数据
export const getWritingCalendar = (params) => {
  return request({
    url: '/detail/writing-calendar',
    method: 'get',
    params
  })
}

// 获取每日写作详情
export const getDailyWritingDetail = (params) => {
  return request({
    url: '/detail/writing-daily-detail',
    method: 'get',
    params
  })
}